package com.lz.ovuola;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.lz.ovuola.util.spring.listener.UserLoginListener;

@SpringBootApplication(scanBasePackages = "com.lz.ovuola")
public class Application {

	@Autowired
	private UserLoginListener userLoginListener;

	private static final SpringApplication APP = new SpringApplication(
			Application.class);

	@PostConstruct
	public void addListener() {
		APP.addListeners(userLoginListener);
	}

	public static void main(String[] args) {
		APP.setWebEnvironment(true);
		APP.setBannerMode(Mode.CONSOLE);
		// APP.setAddCommandLineProperties(false); 禁止 properties属性值
		APP.run(args);
		// APP.exit(context, exitCodeGenerators);
		// System.out.println(FileUtils.uploadFile(
		// "c:/windows/system32/notepad.exe", "exe"));
	}
}
